pkgname=ruijieclient
pkgver=129
pkgrel=1
pkgdesc="基于MyStar的命令行界面的自由锐捷认证Linux客户端"
arch=('i686' 'x86_64')
url="http://code.google.com/p/ruijieclient/"
license=('GPL3')
groups=()
depends=('libnet' 'libpcap')
makedepends=('automake' 'gcc')
provides=("ruijieclient=${pkgver}")
conflicts=('ruijieclient')
replaces=('ruijieclient')
backup=()
options=()
install=$pkgname.install
source=($pkgname.rc
                 ruijie.conf
)
noextract=()
md5sums=()

_svntrunk=http://ruijieclient.googlecode.com/svn/trunk
_svnmod=ruijieclient

build() {
  cd "$srcdir"

  if [ -d $_svnmod/.svn ]; then
    (cd $_svnmod && svn up -r $pkgver)
  else
    svn co $_svntrunk --config-dir ./ -r $pkgver $_svnmod
  fi

  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  rm -rf "$srcdir/$_svnmod-build"
  cp -r "$srcdir/$_svnmod" "$srcdir/$_svnmod-build"
  cd "$srcdir/$_svnmod-build"

  install -D -m755 $srcdir/ruijie.conf ${pkgdir}/etc/$pkgname/ruijie.conf

  ./autogen.sh
  ./configure --prefix=/usr || return 1
  make || return 1
  make DESTDIR="$pkgdir/" install || return 1
  install -Dm755 $srcdir/$pkgname.rc $pkgdir/etc/rc.d/$pkgname
}
